package com.sh.data.engine.common.enumDefinition;

public enum ApiTaskStatus {
    torelease(1, "待发布"),
    released(2, "已发布"),
    unrunning(3, "未运行"),
    running(4, "运行中"),
    success(5, "成功"),
    failure(6, "失败"),
    stopped(7, "停止");

    private Integer status;
    private String name;

    ApiTaskStatus(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getTaskStatus() {
        return status;
    }

    public static ApiTaskStatus from(int apiTaskStatus) {
        for (ApiTaskStatus value : ApiTaskStatus.values()) {
            if (value.getTaskStatus() == apiTaskStatus) {
                return value;
            }
        }
        return null;
    }
}
